using System;
using System.Data;
using System.Xml;
using System.Runtime.Serialization;
using System.Collections;
using System.Collections.Generic;
using Widgetsphere.Core.Logging;
using Widgetsphere.Core.Exceptions;
using Widgetsphere.Core.DataAccess;
using ACME.Northwind.Business;
using ACME.Northwind.Business.Rules;
using Widgetsphere.Core.WinUI;
using ACME.Northwind.Domain.Objects;
using System.ComponentModel;
using Widgetsphere.Core.EventArgs;
using ACME.Northwind.Business.Objects.Composites;
using System.IO;

namespace ACME.Northwind.Business.Objects
{
	/// <summary>
	/// Interface definition for the 'Employee' entity
	/// </summary>
	public interface IEmployee : IPersistableBusinessObject, IAuditable, ICloneable
	{
		#region Properties

		/// <summary>
		/// The Address field
		/// </summary>
		string Address { get; set; }
		/// <summary>
		/// The BirthDate field
		/// </summary>
		DateTime? BirthDate { get; set; }
		/// <summary>
		/// The City field
		/// </summary>
		string City { get; set; }
		/// <summary>
		/// The Country field
		/// </summary>
		string Country { get; set; }
		/// <summary>
		/// The EmployeeId field
		/// </summary>
		int EmployeeId { get; }
		/// <summary>
		/// The Extension field
		/// </summary>
		string Extension { get; set; }
		/// <summary>
		/// The FirstName field
		/// </summary>
		string FirstName { get; set; }
		/// <summary>
		/// The HireDate field
		/// </summary>
		DateTime? HireDate { get; set; }
		/// <summary>
		/// The HomePhone field
		/// </summary>
		string HomePhone { get; set; }
		/// <summary>
		/// The LastName field
		/// </summary>
		string LastName { get; set; }
		/// <summary>
		/// The Notes field
		/// </summary>
		string Notes { get; set; }
		/// <summary>
		/// The Photo field
		/// </summary>
		System.Byte[] Photo { get; set; }
		/// <summary>
		/// The PhotoPath field
		/// </summary>
		string PhotoPath { get; set; }
		/// <summary>
		/// The PostalCode field
		/// </summary>
		string PostalCode { get; set; }
		/// <summary>
		/// The Region field
		/// </summary>
		string Region { get; set; }
		/// <summary>
		/// The ReportsTo field
		/// </summary>
		int? ReportsTo { get; set; }
		/// <summary>
		/// The Title field
		/// </summary>
		string Title { get; set; }
		/// <summary>
		/// The TitleOfCourtesy field
		/// </summary>
		string TitleOfCourtesy { get; set; }

		#endregion

		#region Methods

		/// <summary>
		/// This event is called before persisting to the database.
		/// </summary>
		event EventHandler<BusinessObjectEventArgs> Validate;

		/// <summary>
		/// Removes this object from its parent collection. It will not be deleted from the database.
		/// </summary>
		void Remove();

		/// <summary>
		/// The primary key for this object
		/// </summary>
		new EmployeePrimaryKey PrimaryKey { get; }

		/// <summary>
		/// Persists this object to the database.
		/// </summary>
		new void Persist();

		/// <summary>
		/// Creates a clone of this object.
		/// </summary>
		new IBusinessObject Clone();

		#endregion

	}

	/// <summary>
	/// Class definition for the 'Employee' entity
	/// </summary>
	[Serializable()]
	public partial class Employee : BusinessObjectPersistableBase, IPersistableBusinessObject, IEmployee
	{
		#region Class Members

		#region FieldNameConstants Enumeration

		/// <summary>
		/// An enumeration of this object's image type fields
		/// </summary>
		public enum FieldImageConstants
		{
			 /// <summary>
			 /// Field mapping for the image column 'Photo' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the image column 'Photo' property")]
			Photo,
		}

		#endregion

		#region FieldNameConstants Enumeration

		/// <summary>
		/// Enumeration to define each property that maps to a database field for the 'Employee' table.
		/// </summary>
		public enum FieldNameConstants
		{
			 /// <summary>
			 /// Field mapping for the 'TitleOfCourtesy' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'TitleOfCourtesy' property")]
			TitleOfCourtesy,
			 /// <summary>
			 /// Field mapping for the 'Title' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Title' property")]
			Title,
			 /// <summary>
			 /// Field mapping for the 'ReportsTo' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'ReportsTo' property")]
			ReportsTo,
			 /// <summary>
			 /// Field mapping for the 'Region' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Region' property")]
			Region,
			 /// <summary>
			 /// Field mapping for the 'PostalCode' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'PostalCode' property")]
			PostalCode,
			 /// <summary>
			 /// Field mapping for the 'PhotoPath' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'PhotoPath' property")]
			PhotoPath,
			 /// <summary>
			 /// Field mapping for the 'Photo' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Photo' property")]
			Photo,
			 /// <summary>
			 /// Field mapping for the 'Notes' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Notes' property")]
			Notes,
			 /// <summary>
			 /// Field mapping for the 'LastName' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'LastName' property")]
			LastName,
			 /// <summary>
			 /// Field mapping for the 'HomePhone' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'HomePhone' property")]
			HomePhone,
			 /// <summary>
			 /// Field mapping for the 'HireDate' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'HireDate' property")]
			HireDate,
			 /// <summary>
			 /// Field mapping for the 'FirstName' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'FirstName' property")]
			FirstName,
			 /// <summary>
			 /// Field mapping for the 'Extension' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Extension' property")]
			Extension,
			 /// <summary>
			 /// Field mapping for the 'EmployeeId' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'EmployeeId' property")]
			EmployeeId,
			 /// <summary>
			 /// Field mapping for the 'Country' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Country' property")]
			Country,
			 /// <summary>
			 /// Field mapping for the 'City' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'City' property")]
			City,
			 /// <summary>
			 /// Field mapping for the 'BirthDate' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'BirthDate' property")]
			BirthDate,
			 /// <summary>
			 /// Field mapping for the 'Address' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'Address' property")]
			Address,
			 /// <summary>
			 /// Field mapping for the 'CreatedBy' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'CreatedBy' property")]
			CreatedBy,
			 /// <summary>
			 /// Field mapping for the 'CreatedDate' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'CreatedDate' property")]
			CreatedDate,
			 /// <summary>
			 /// Field mapping for the 'ModifiedBy' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'ModifiedBy' property")]
			ModifiedBy,
			 /// <summary>
			 /// Field mapping for the 'ModifiedDate' property
			 /// </summary>
			[System.ComponentModel.Description("Field mapping for the 'ModifiedDate' property")]
			ModifiedDate,
		}
		#endregion

		internal DomainEmployee wrappedClass;

		#endregion

		#region Constructors

		/// <summary>
		/// Creates a 'Employee' object from a domain object
		/// </summary>
		internal Employee(DomainEmployee classToWrap)
		{
			wrappedClass = classToWrap;
		}

		/// <summary>
		/// Creates a 'Employee' object from a DataRowView
		/// </summary>
		internal Employee(DataRowView drvToWrap)
		{
			wrappedClass = (DomainEmployee)drvToWrap.Row;
		}

		#endregion

		#region Events

		/// <summary>
		/// This event is raised before the 'Address' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> AddressChanging;

		/// <summary>
		/// This event is raised when the 'Address' field is changed.
		/// </summary>
		public event EventHandler AddressChanged;

		/// <summary>
		/// This event is raised before the 'BirthDate' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<DateTime?>> BirthDateChanging;

		/// <summary>
		/// This event is raised when the 'BirthDate' field is changed.
		/// </summary>
		public event EventHandler BirthDateChanged;

		/// <summary>
		/// This event is raised before the 'City' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> CityChanging;

		/// <summary>
		/// This event is raised when the 'City' field is changed.
		/// </summary>
		public event EventHandler CityChanged;

		/// <summary>
		/// This event is raised before the 'Country' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> CountryChanging;

		/// <summary>
		/// This event is raised when the 'Country' field is changed.
		/// </summary>
		public event EventHandler CountryChanged;

		/// <summary>
		/// This event is raised before the 'EmployeeId' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<int>> EmployeeIdChanging;

		/// <summary>
		/// This event is raised when the 'EmployeeId' field is changed.
		/// </summary>
		public event EventHandler EmployeeIdChanged;

		/// <summary>
		/// This event is raised before the 'Extension' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> ExtensionChanging;

		/// <summary>
		/// This event is raised when the 'Extension' field is changed.
		/// </summary>
		public event EventHandler ExtensionChanged;

		/// <summary>
		/// This event is raised before the 'FirstName' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> FirstNameChanging;

		/// <summary>
		/// This event is raised when the 'FirstName' field is changed.
		/// </summary>
		public event EventHandler FirstNameChanged;

		/// <summary>
		/// This event is raised before the 'HireDate' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<DateTime?>> HireDateChanging;

		/// <summary>
		/// This event is raised when the 'HireDate' field is changed.
		/// </summary>
		public event EventHandler HireDateChanged;

		/// <summary>
		/// This event is raised before the 'HomePhone' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> HomePhoneChanging;

		/// <summary>
		/// This event is raised when the 'HomePhone' field is changed.
		/// </summary>
		public event EventHandler HomePhoneChanged;

		/// <summary>
		/// This event is raised before the 'LastName' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> LastNameChanging;

		/// <summary>
		/// This event is raised when the 'LastName' field is changed.
		/// </summary>
		public event EventHandler LastNameChanged;

		/// <summary>
		/// This event is raised before the 'Notes' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> NotesChanging;

		/// <summary>
		/// This event is raised when the 'Notes' field is changed.
		/// </summary>
		public event EventHandler NotesChanged;

		/// <summary>
		/// This event is raised before the 'Photo' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<System.Byte[]>> PhotoChanging;

		/// <summary>
		/// This event is raised when the 'Photo' field is changed.
		/// </summary>
		public event EventHandler PhotoChanged;

		/// <summary>
		/// This event is raised before the 'PhotoPath' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> PhotoPathChanging;

		/// <summary>
		/// This event is raised when the 'PhotoPath' field is changed.
		/// </summary>
		public event EventHandler PhotoPathChanged;

		/// <summary>
		/// This event is raised before the 'PostalCode' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> PostalCodeChanging;

		/// <summary>
		/// This event is raised when the 'PostalCode' field is changed.
		/// </summary>
		public event EventHandler PostalCodeChanged;

		/// <summary>
		/// This event is raised before the 'Region' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> RegionChanging;

		/// <summary>
		/// This event is raised when the 'Region' field is changed.
		/// </summary>
		public event EventHandler RegionChanged;

		/// <summary>
		/// This event is raised before the 'ReportsTo' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<int?>> ReportsToChanging;

		/// <summary>
		/// This event is raised when the 'ReportsTo' field is changed.
		/// </summary>
		public event EventHandler ReportsToChanged;

		/// <summary>
		/// This event is raised before the 'Title' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> TitleChanging;

		/// <summary>
		/// This event is raised when the 'Title' field is changed.
		/// </summary>
		public event EventHandler TitleChanged;

		/// <summary>
		/// This event is raised before the 'TitleOfCourtesy' field is changed providing a chance to cancel the action.
		/// </summary>
		public event EventHandler<BusinessObjectCancelEventArgs<string>> TitleOfCourtesyChanging;

		/// <summary>
		/// This event is raised when the 'TitleOfCourtesy' field is changed.
		/// </summary>
		public event EventHandler TitleOfCourtesyChanged;

		/// <summary>
		/// Raises the AddressChanging event.
		/// </summary>
		protected virtual void OnAddressChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.AddressChanging != null)
				this.AddressChanging(this, e);
		}

		/// <summary>
		/// Raises the AddressChanged event.
		/// </summary>
		protected virtual void OnAddressChanged(System.EventArgs e)
		{
			if (this.AddressChanged != null)
				this.AddressChanged(this, e);
		}

		/// <summary>
		/// Raises the BirthDateChanging event.
		/// </summary>
		protected virtual void OnBirthDateChanging(BusinessObjectCancelEventArgs<DateTime?> e)
		{
			if (this.BirthDateChanging != null)
				this.BirthDateChanging(this, e);
		}

		/// <summary>
		/// Raises the BirthDateChanged event.
		/// </summary>
		protected virtual void OnBirthDateChanged(System.EventArgs e)
		{
			if (this.BirthDateChanged != null)
				this.BirthDateChanged(this, e);
		}

		/// <summary>
		/// Raises the CityChanging event.
		/// </summary>
		protected virtual void OnCityChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.CityChanging != null)
				this.CityChanging(this, e);
		}

		/// <summary>
		/// Raises the CityChanged event.
		/// </summary>
		protected virtual void OnCityChanged(System.EventArgs e)
		{
			if (this.CityChanged != null)
				this.CityChanged(this, e);
		}

		/// <summary>
		/// Raises the CountryChanging event.
		/// </summary>
		protected virtual void OnCountryChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.CountryChanging != null)
				this.CountryChanging(this, e);
		}

		/// <summary>
		/// Raises the CountryChanged event.
		/// </summary>
		protected virtual void OnCountryChanged(System.EventArgs e)
		{
			if (this.CountryChanged != null)
				this.CountryChanged(this, e);
		}

		/// <summary>
		/// Raises the EmployeeIdChanging event.
		/// </summary>
		protected virtual void OnEmployeeIdChanging(BusinessObjectCancelEventArgs<int> e)
		{
			if (this.EmployeeIdChanging != null)
				this.EmployeeIdChanging(this, e);
		}

		/// <summary>
		/// Raises the EmployeeIdChanged event.
		/// </summary>
		protected virtual void OnEmployeeIdChanged(System.EventArgs e)
		{
			if (this.EmployeeIdChanged != null)
				this.EmployeeIdChanged(this, e);
		}

		/// <summary>
		/// Raises the ExtensionChanging event.
		/// </summary>
		protected virtual void OnExtensionChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.ExtensionChanging != null)
				this.ExtensionChanging(this, e);
		}

		/// <summary>
		/// Raises the ExtensionChanged event.
		/// </summary>
		protected virtual void OnExtensionChanged(System.EventArgs e)
		{
			if (this.ExtensionChanged != null)
				this.ExtensionChanged(this, e);
		}

		/// <summary>
		/// Raises the FirstNameChanging event.
		/// </summary>
		protected virtual void OnFirstNameChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.FirstNameChanging != null)
				this.FirstNameChanging(this, e);
		}

		/// <summary>
		/// Raises the FirstNameChanged event.
		/// </summary>
		protected virtual void OnFirstNameChanged(System.EventArgs e)
		{
			if (this.FirstNameChanged != null)
				this.FirstNameChanged(this, e);
		}

		/// <summary>
		/// Raises the HireDateChanging event.
		/// </summary>
		protected virtual void OnHireDateChanging(BusinessObjectCancelEventArgs<DateTime?> e)
		{
			if (this.HireDateChanging != null)
				this.HireDateChanging(this, e);
		}

		/// <summary>
		/// Raises the HireDateChanged event.
		/// </summary>
		protected virtual void OnHireDateChanged(System.EventArgs e)
		{
			if (this.HireDateChanged != null)
				this.HireDateChanged(this, e);
		}

		/// <summary>
		/// Raises the HomePhoneChanging event.
		/// </summary>
		protected virtual void OnHomePhoneChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.HomePhoneChanging != null)
				this.HomePhoneChanging(this, e);
		}

		/// <summary>
		/// Raises the HomePhoneChanged event.
		/// </summary>
		protected virtual void OnHomePhoneChanged(System.EventArgs e)
		{
			if (this.HomePhoneChanged != null)
				this.HomePhoneChanged(this, e);
		}

		/// <summary>
		/// Raises the LastNameChanging event.
		/// </summary>
		protected virtual void OnLastNameChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.LastNameChanging != null)
				this.LastNameChanging(this, e);
		}

		/// <summary>
		/// Raises the LastNameChanged event.
		/// </summary>
		protected virtual void OnLastNameChanged(System.EventArgs e)
		{
			if (this.LastNameChanged != null)
				this.LastNameChanged(this, e);
		}

		/// <summary>
		/// Raises the NotesChanging event.
		/// </summary>
		protected virtual void OnNotesChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.NotesChanging != null)
				this.NotesChanging(this, e);
		}

		/// <summary>
		/// Raises the NotesChanged event.
		/// </summary>
		protected virtual void OnNotesChanged(System.EventArgs e)
		{
			if (this.NotesChanged != null)
				this.NotesChanged(this, e);
		}

		/// <summary>
		/// Raises the PhotoChanging event.
		/// </summary>
		protected virtual void OnPhotoChanging(BusinessObjectCancelEventArgs<System.Byte[]> e)
		{
			if (this.PhotoChanging != null)
				this.PhotoChanging(this, e);
		}

		/// <summary>
		/// Raises the PhotoChanged event.
		/// </summary>
		protected virtual void OnPhotoChanged(System.EventArgs e)
		{
			if (this.PhotoChanged != null)
				this.PhotoChanged(this, e);
		}

		/// <summary>
		/// Raises the PhotoPathChanging event.
		/// </summary>
		protected virtual void OnPhotoPathChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.PhotoPathChanging != null)
				this.PhotoPathChanging(this, e);
		}

		/// <summary>
		/// Raises the PhotoPathChanged event.
		/// </summary>
		protected virtual void OnPhotoPathChanged(System.EventArgs e)
		{
			if (this.PhotoPathChanged != null)
				this.PhotoPathChanged(this, e);
		}

		/// <summary>
		/// Raises the PostalCodeChanging event.
		/// </summary>
		protected virtual void OnPostalCodeChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.PostalCodeChanging != null)
				this.PostalCodeChanging(this, e);
		}

		/// <summary>
		/// Raises the PostalCodeChanged event.
		/// </summary>
		protected virtual void OnPostalCodeChanged(System.EventArgs e)
		{
			if (this.PostalCodeChanged != null)
				this.PostalCodeChanged(this, e);
		}

		/// <summary>
		/// Raises the RegionChanging event.
		/// </summary>
		protected virtual void OnRegionChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.RegionChanging != null)
				this.RegionChanging(this, e);
		}

		/// <summary>
		/// Raises the RegionChanged event.
		/// </summary>
		protected virtual void OnRegionChanged(System.EventArgs e)
		{
			if (this.RegionChanged != null)
				this.RegionChanged(this, e);
		}

		/// <summary>
		/// Raises the ReportsToChanging event.
		/// </summary>
		protected virtual void OnReportsToChanging(BusinessObjectCancelEventArgs<int?> e)
		{
			if (this.ReportsToChanging != null)
				this.ReportsToChanging(this, e);
		}

		/// <summary>
		/// Raises the ReportsToChanged event.
		/// </summary>
		protected virtual void OnReportsToChanged(System.EventArgs e)
		{
			if (this.ReportsToChanged != null)
				this.ReportsToChanged(this, e);
		}

		/// <summary>
		/// Raises the TitleChanging event.
		/// </summary>
		protected virtual void OnTitleChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.TitleChanging != null)
				this.TitleChanging(this, e);
		}

		/// <summary>
		/// Raises the TitleChanged event.
		/// </summary>
		protected virtual void OnTitleChanged(System.EventArgs e)
		{
			if (this.TitleChanged != null)
				this.TitleChanged(this, e);
		}

		/// <summary>
		/// Raises the TitleOfCourtesyChanging event.
		/// </summary>
		protected virtual void OnTitleOfCourtesyChanging(BusinessObjectCancelEventArgs<string> e)
		{
			if (this.TitleOfCourtesyChanging != null)
				this.TitleOfCourtesyChanging(this, e);
		}

		/// <summary>
		/// Raises the TitleOfCourtesyChanged event.
		/// </summary>
		protected virtual void OnTitleOfCourtesyChanged(System.EventArgs e)
		{
			if (this.TitleOfCourtesyChanged != null)
				this.TitleOfCourtesyChanged(this, e);
		}

		#endregion

		#region Properties

		/// <summary>
		/// The current state of this object.
		/// </summary>
		public Widgetsphere.Core.DataAccess.SubDomainBase.ItemStateConstants ItemState
		{
			get { return (Widgetsphere.Core.DataAccess.SubDomainBase.ItemStateConstants)int.Parse(wrappedClass.RowState.ToString("d")); }
		}

		/// <summary>
		/// Determines the type of collection that contains this object.
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		public Collections Container
		{
			get { return Collections.EmployeeCollection; }
		}

		#region CreatedBy / ModifiedBy Section

		/// <summary>
		/// The audit field for the 'Modified By' column.
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		public virtual string ModifiedBy
		{
			get
			{
				object o = this.wrappedClass[this.wrappedClass.ParentCol.ModifiedByColumn];
				if (o == DBNull.Value) return null;
				else return (string)o;
			}
			internal set { this.wrappedClass[this.wrappedClass.ParentCol.ModifiedByColumn] = value; }
		}

		/// <summary>
		/// The audit field for the 'Modified Date' column.
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		public virtual DateTime? ModifiedDate
		{
			get
			{
				object o = this.wrappedClass[this.wrappedClass.ParentCol.ModifiedDateColumn];
				if (o == DBNull.Value) return null;
				else return (DateTime)o;
			}
			internal set { this.wrappedClass[this.wrappedClass.ParentCol.ModifiedDateColumn] = value; }
		}

		/// <summary>
		/// Sets 'ModifiedBy' column.
		/// </summary>
		public virtual void SetModifiedDate(DateTime newValue)
		{
			this.wrappedClass[this.wrappedClass.ParentCol.ModifiedDateColumn] = newValue;
		}

		/// <summary>
		/// The audit field for the 'Created By' column.
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		public virtual string CreatedBy
		{
			get
			{
				object o = this.wrappedClass[this.wrappedClass.ParentCol.CreatedByColumn];
				if (o == DBNull.Value) return null;
				else return (string)o;
			}
			internal set { this.wrappedClass[this.wrappedClass.ParentCol.CreatedByColumn] = value; }
		}

		/// <summary>
		/// The audit field for the 'Created Date' column.
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		public virtual DateTime? CreatedDate
		{
			get
			{
				object o = this.wrappedClass[this.wrappedClass.ParentCol.CreatedDateColumn];
				if (o == DBNull.Value) return null;
				else return (DateTime)o;
			}
			internal set { this.wrappedClass[this.wrappedClass.ParentCol.CreatedDateColumn] = value; }
		}

		/// <summary>
		/// Sets 'ModifiedBy' column.
		/// </summary>
		public virtual void SetCreatedDate(DateTime newValue)
		{
			this.wrappedClass[this.wrappedClass.ParentCol.CreatedDateColumn] = newValue;
		}

		[System.ComponentModel.Browsable(false)]
		internal virtual byte[] TimeStamp
		{
			get
			{
				 object o = this.wrappedClass[this.wrappedClass.ParentCol.TimeStampColumn];
				 return (byte[])o;
			}
			set { this.wrappedClass[this.wrappedClass.ParentCol.TimeStampColumn] = value; }
		}

		#endregion

		/// <summary>
		/// Determines if this object is part of a collection or is detached
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		public virtual bool IsParented
		{
		  get { return (((DataRow)this.WrappedClass).RowState != DataRowState.Detached); }
		}

		/// <summary>
		/// Returns the internal object that this object wraps
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		internal virtual object WrappedClass
		{
			get{ return wrappedClass; }
			set{ wrappedClass = (DomainEmployee)value; }
		}

		//WrappingClass Interface
		object IWrappingClass.WrappedClass
		{
			get { return this.WrappedClass; }
			set { this.WrappedClass = value; }
		}

		/// <summary>
		/// The primary key for this object
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		public virtual EmployeePrimaryKey PrimaryKey
		{
			get
			{
				try
				{
					return wrappedClass.PrimaryKey;
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
		}

		/// <summary>
		/// Property for table field: Address
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string Address
		{
			get
			{
				try { return wrappedClass.Address; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.Address))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.Address", GetMaxLength(FieldNameConstants.Address)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnAddressChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Address = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Address"));
						this.OnAddressChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: BirthDate
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual DateTime? BirthDate
		{
			get
			{
				try { return wrappedClass.BirthDate; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				try
				{
					BusinessObjectCancelEventArgs<DateTime?> cancelArgs = new BusinessObjectCancelEventArgs<DateTime?>(value);
					this.OnBirthDateChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.BirthDate = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("BirthDate"));
						this.OnBirthDateChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: City
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string City
		{
			get
			{
				try { return wrappedClass.City; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.City))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.City", GetMaxLength(FieldNameConstants.City)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnCityChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.City = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("City"));
						this.OnCityChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: Country
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string Country
		{
			get
			{
				try { return wrappedClass.Country; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.Country))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.Country", GetMaxLength(FieldNameConstants.Country)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnCountryChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Country = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Country"));
						this.OnCountryChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: EmployeeID
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual int EmployeeId
		{
			get
			{
				try { return wrappedClass.EmployeeId; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
		}

		/// <summary>
		/// Property for table field: Extension
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string Extension
		{
			get
			{
				try { return wrappedClass.Extension; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.Extension))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.Extension", GetMaxLength(FieldNameConstants.Extension)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnExtensionChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Extension = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Extension"));
						this.OnExtensionChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: FirstName
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string FirstName
		{
			get
			{
				try { return wrappedClass.FirstName; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.FirstName))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.FirstName", GetMaxLength(FieldNameConstants.FirstName)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnFirstNameChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.FirstName = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("FirstName"));
						this.OnFirstNameChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: HireDate
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual DateTime? HireDate
		{
			get
			{
				try { return wrappedClass.HireDate; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				try
				{
					BusinessObjectCancelEventArgs<DateTime?> cancelArgs = new BusinessObjectCancelEventArgs<DateTime?>(value);
					this.OnHireDateChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.HireDate = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("HireDate"));
						this.OnHireDateChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: HomePhone
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string HomePhone
		{
			get
			{
				try { return wrappedClass.HomePhone; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.HomePhone))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.HomePhone", GetMaxLength(FieldNameConstants.HomePhone)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnHomePhoneChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.HomePhone = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("HomePhone"));
						this.OnHomePhoneChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: LastName
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string LastName
		{
			get
			{
				try { return wrappedClass.LastName; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.LastName))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.LastName", GetMaxLength(FieldNameConstants.LastName)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnLastNameChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.LastName = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("LastName"));
						this.OnLastNameChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: Notes
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string Notes
		{
			get
			{
				try { return wrappedClass.Notes; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.Notes))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.Notes", GetMaxLength(FieldNameConstants.Notes)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnNotesChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Notes = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Notes"));
						this.OnNotesChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: Photo
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual System.Byte[] Photo
		{
			get
			{
				try { return wrappedClass.Photo; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				try
				{
					BusinessObjectCancelEventArgs<System.Byte[]> cancelArgs = new BusinessObjectCancelEventArgs<System.Byte[]>(value);
					this.OnPhotoChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Photo = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Photo"));
						this.OnPhotoChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: PhotoPath
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string PhotoPath
		{
			get
			{
				try { return wrappedClass.PhotoPath; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.PhotoPath))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.PhotoPath", GetMaxLength(FieldNameConstants.PhotoPath)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnPhotoPathChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.PhotoPath = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("PhotoPath"));
						this.OnPhotoPathChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: PostalCode
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string PostalCode
		{
			get
			{
				try { return wrappedClass.PostalCode; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.PostalCode))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.PostalCode", GetMaxLength(FieldNameConstants.PostalCode)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnPostalCodeChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.PostalCode = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("PostalCode"));
						this.OnPostalCodeChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: Region
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string Region
		{
			get
			{
				try { return wrappedClass.Region; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.Region))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.Region", GetMaxLength(FieldNameConstants.Region)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnRegionChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Region = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Region"));
						this.OnRegionChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: ReportsTo
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual int? ReportsTo
		{
			get
			{
				try { return wrappedClass.ReportsTo; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				try
				{

					BusinessObjectCancelEventArgs<int?> cancelArgs = new BusinessObjectCancelEventArgs<int?>(value);
					this.OnReportsToChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.ReportsTo = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("ReportsTo"));
						this.OnReportsToChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: Title
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string Title
		{
			get
			{
				try { return wrappedClass.Title; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.Title))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.Title", GetMaxLength(FieldNameConstants.Title)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnTitleChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.Title = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("Title"));
						this.OnTitleChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		/// <summary>
		/// Property for table field: TitleOfCourtesy
		/// </summary>
		[System.ComponentModel.Browsable(true)]
		[System.ComponentModel.Description("")]
		[Widgetsphere.Core.Attributes.DataSetting("", false, 0)]
		public virtual string TitleOfCourtesy
		{
			get
			{
				try { return wrappedClass.TitleOfCourtesy; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				if ((value != null) && (value.Length > GetMaxLength(FieldNameConstants.TitleOfCourtesy))) throw new Exception(string.Format(GlobalValues.ERROR_DATA_TOO_BIG, value, "Employee.TitleOfCourtesy", GetMaxLength(FieldNameConstants.TitleOfCourtesy)));
				try
				{
					BusinessObjectCancelEventArgs<string> cancelArgs = new BusinessObjectCancelEventArgs<string>(value);
					this.OnTitleOfCourtesyChanging(cancelArgs);
					if (!cancelArgs.Cancel)
					{
						lock (this)
						{
							wrappedClass.TitleOfCourtesy = cancelArgs.NewValue;
						}
						this.ModifiedDate = DateTime.Now;
						this.OnPropertyChanged(new PropertyChangedEventArgs("TitleOfCourtesy"));
						this.OnTitleOfCourtesyChanged(new EventArgs());
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}

		}

		internal virtual void ReleaseNonIdentifyingRelationships()
		{
			try
			{
				wrappedClass.ReleaseNonIdentifyingRelationships();
			}
			catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
			catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
			catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
		}

		/// <summary>
		/// A list of related 'EmployeeTerritory' items
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		public virtual BusinessObjectList<EmployeeTerritory> EmployeeTerritoryList
		{
			get
			{
				try
				{
					if (this.ParentCollection == null)
					{
						lock (this)
						{
							return wrappedClass.EmployeeTerritoryList;
						}
					}
					else
					{
						lock (this.ParentCollection.SubDomain)
						{
							return wrappedClass.EmployeeTerritoryList;
						}
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
		}

		/// <summary>
		/// A list of related 'Order' items
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		public virtual BusinessObjectList<Order> OrderList
		{
			get
			{
				try
				{
					if (this.ParentCollection == null)
					{
						lock (this)
						{
							return wrappedClass.OrderList;
						}
					}
					else
					{
						lock (this.ParentCollection.SubDomain)
						{
							return wrappedClass.OrderList;
						}
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
		}


		#endregion

		#region Self Reference

		public virtual BusinessObjectList<Employee> ChildEmployeeList
		{
			get
			{
				try { return wrappedClass.ChildEmployeeList; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
		}

		public virtual Employee ParentEmployeeItem
		{
			get
			{
				try
				{
					if (wrappedClass.ParentEmployeeItem != null)
					{
						return new Employee(wrappedClass.ParentEmployeeItem);
					}
					else
					{
						return null;
					}
				}
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
			set
			{
				try { wrappedClass.ParentEmployeeItem = value.wrappedClass; }
				catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
				catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
				catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
			}
		}

		#endregion

		#region Collection Operation Methods

		/// <summary>
		/// This event is called before persisting to the database.
		/// </summary>
		public event EventHandler<BusinessObjectEventArgs> Validate;

		/// <summary>
		/// This event is called before persisting to store.
		/// </summary>
		/// <param name="item"></param>
		protected internal void OnValidate(BusinessObjectEventArgs item)
		{
			if (this.Validate != null)
				this.Validate(this, item);
		}

		/// <summary>
		/// Persists this object to the database.
		/// </summary>
		public override void Persist()
		{
		  if (this.IsParented)
		  {
				this.OnValidate(new BusinessObjectEventArgs(this));
			  wrappedClass.Persist();
		  }
		  else
		    throw new Exception("This item is not part of a collection and cannot be persisted!");
		}

		/// <summary>
		/// Removes this object from its parent collection. It will not be deleted from the database.
		/// </summary>
		public void Remove()
		{
			try
			{
				if (this.ParentCollection == null)
				{
					lock (this)
					{
						wrappedClass.Remove();
					}
				}
				else
				{
					lock (this.ParentCollection.SubDomain)
					{
						wrappedClass.Remove();
					}
				}
			}
			catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
			catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
			catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
		}

		/// <summary>
		/// Marks this object for deletion. The next call to the Persist method will delete it from the database.
		/// </summary>
		public void Delete()
		{
			try
			{
				if (this.ParentCollection == null)
				{
					lock (this)
					{
						wrappedClass.Delete();
					}
				}
				else
				{
					lock (this.ParentCollection.SubDomain)
					{
						wrappedClass.Delete();
					}
				}
			}
			catch (System.Data.DBConcurrencyException dbcex) { throw new ConcurrencyException(GlobalValues.ERROR_CONCURRENCY_FAILURE, dbcex); }
			catch (System.Data.SqlClient.SqlException sqlexp) { if (sqlexp.Number == 547 || sqlexp.Number == 2627) throw new UniqueConstraintViolatedException(GlobalValues.ERROR_CONSTRAINT_FAILURE, sqlexp); else throw; }
			catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); throw; }
		}

		#endregion

		#region Overrides

		/// <summary>
		/// Serves as a hash function for this particular type.
		/// </summary>
		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		/// <summary>
		/// Returns a value indicating whether the current object is equal to a specified object.
		/// </summary>
		public override bool Equals(object obj)
		{
			if (obj == null) return false;
			if (obj.GetType() == this.GetType())
			{
				if (this.wrappedClass.Equals(((Employee)obj).wrappedClass))
					return true;
			}
			else if(obj.GetType() == this.PrimaryKey.GetType())
			{
			  if(this.PrimaryKey.Equals(obj))
			    return true;
			}
			else if (obj.GetType() == this.PrimaryKey.EmployeeId.GetType())
			{
				if (this.PrimaryKey.EmployeeId.Equals(obj))
					return true;
			}
			return false;
		}

		#endregion

		#region IBusinessObject ParentCollection

		/// <summary>
		/// This is a reference back to the generic collection that holds this object.
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		IBusinessCollection IBusinessObject.ParentCollection
		{
			get { return this.ParentCollection; }
		}

		#endregion

		#region ParentCollection

		/// <summary>
		/// This is a reference back to the collection that holds this object.
		/// </summary>
		[System.ComponentModel.Browsable(false)]
		public EmployeeCollection ParentCollection
		{
			get { return new EmployeeCollection(wrappedClass.ParentCol); }
		}

		#endregion

		#region GetDefault

		/// <summary>
		/// Gets the default value of one of this object's properties.
		/// </summary>
		public object GetDefault(FieldNameConstants field)
		{
			if(field == FieldNameConstants.Address)
				return "";
			if(field == FieldNameConstants.BirthDate)
				return null;
			if(field == FieldNameConstants.City)
				return "";
			if(field == FieldNameConstants.Country)
				return "";
			if(field == FieldNameConstants.EmployeeId)
				return 0;
			if(field == FieldNameConstants.Extension)
				return "";
			if(field == FieldNameConstants.FirstName)
				return "";
			if(field == FieldNameConstants.HireDate)
				return null;
			if(field == FieldNameConstants.HomePhone)
				return "";
			if(field == FieldNameConstants.LastName)
				return "";
			if(field == FieldNameConstants.Notes)
				return "";
			if(field == FieldNameConstants.Photo)
				return null;
			if(field == FieldNameConstants.PhotoPath)
				return "";
			if(field == FieldNameConstants.PostalCode)
				return "";
			if(field == FieldNameConstants.Region)
				return "";
			if(field == FieldNameConstants.ReportsTo)
				return null;
			if(field == FieldNameConstants.Title)
				return "";
			if(field == FieldNameConstants.TitleOfCourtesy)
				return "";

			return null;
		}

		object IBusinessObject.GetDefault(Enum field)
		{
			return this.GetDefault((FieldNameConstants)field);
		}

		#endregion

		#region GetValue

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public object GetValue(FieldNameConstants field)
		{
			return GetValue(field, null);
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public object GetValue(FieldNameConstants field, object defaultValue)
		{
			if(field == FieldNameConstants.TitleOfCourtesy)
				return ((this.TitleOfCourtesy == null) ? defaultValue : this.TitleOfCourtesy);
			if(field == FieldNameConstants.Title)
				return ((this.Title == null) ? defaultValue : this.Title);
			if(field == FieldNameConstants.ReportsTo)
				return ((this.ReportsTo == null) ? defaultValue : this.ReportsTo);
			if(field == FieldNameConstants.Region)
				return ((this.Region == null) ? defaultValue : this.Region);
			if(field == FieldNameConstants.PostalCode)
				return ((this.PostalCode == null) ? defaultValue : this.PostalCode);
			if(field == FieldNameConstants.PhotoPath)
				return ((this.PhotoPath == null) ? defaultValue : this.PhotoPath);
			if(field == FieldNameConstants.Photo)
				return ((this.Photo == null) ? defaultValue : this.Photo);
			if(field == FieldNameConstants.Notes)
				return ((this.Notes == null) ? defaultValue : this.Notes);
			if(field == FieldNameConstants.LastName)
				return this.LastName;
			if(field == FieldNameConstants.HomePhone)
				return ((this.HomePhone == null) ? defaultValue : this.HomePhone);
			if(field == FieldNameConstants.HireDate)
				return ((this.HireDate == null) ? defaultValue : this.HireDate);
			if(field == FieldNameConstants.FirstName)
				return this.FirstName;
			if(field == FieldNameConstants.Extension)
				return ((this.Extension == null) ? defaultValue : this.Extension);
			if(field == FieldNameConstants.EmployeeId)
				return this.EmployeeId;
			if(field == FieldNameConstants.Country)
				return ((this.Country == null) ? defaultValue : this.Country);
			if(field == FieldNameConstants.City)
				return ((this.City == null) ? defaultValue : this.City);
			if(field == FieldNameConstants.BirthDate)
				return ((this.BirthDate == null) ? defaultValue : this.BirthDate);
			if(field == FieldNameConstants.Address)
				return ((this.Address == null) ? defaultValue : this.Address);
			throw new Exception("Field '" + field.ToString() + "' not found!");
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public int GetInteger(FieldNameConstants field)
		{
			return this.GetInteger(field, int.MinValue);
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public int GetInteger(FieldNameConstants field, int defaultValue)
		{
			object o = this.GetValue(field, defaultValue);
			if (o is string)
			{
				int a;
				if (int.TryParse((string)o, out a))
					return a;
				else
					throw new InvalidCastException();
			}
			else
			{
				return (int)o;
			}
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public double GetDouble(FieldNameConstants field)
		{
			return this.GetDouble(field, double.MinValue);
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public double GetDouble(FieldNameConstants field, double defaultValue)
		{
			object o = this.GetValue(field, defaultValue);
			if (o is string)
			{
				double a;
				if (double.TryParse((string)o, out a))
					return a;
				else
					throw new InvalidCastException();
			}
			else
			{
				return (double)o;
			}
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public DateTime GetDateTime(FieldNameConstants field)
		{
			return this.GetDateTime(field, DateTime.MinValue);
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public DateTime GetDateTime(FieldNameConstants field, DateTime defaultValue)
		{
			object o = this.GetValue(field, defaultValue);
			if (o is string)
			{
				DateTime a;
				if (DateTime.TryParse((string)o, out a))
					return a;
				else
					throw new InvalidCastException();
			}
			else
			{
				return (DateTime)o;
			}
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public string GetString(FieldNameConstants field)
		{
			return this.GetString(field, "");
		}

		/// <summary>
		/// Gets the value of one of this object's properties.
		/// </summary>
		public string GetString(FieldNameConstants field, string defaultValue)
		{
			object o = this.GetValue(field, defaultValue);
			if (o is string)
			{
				return (string)o;
			}
			else
			{
				return o.ToString();
			}
		}

		#endregion

		#region SetValue

		/// <summary>
		/// Assigns a value to a field on this object.
		/// </summary>
		/// <param name="field">The field to set</param>
		/// <param name="newValue">The new value to assign to the field</param>
		public void SetValue(FieldNameConstants field, object newValue)
		{
			SetValue(field, newValue, false);
		}

		/// <summary>
		/// Assigns a value to a field on this object.
		/// </summary>
		/// <param name="field">The field to set</param>
		/// <param name="newValue">The new value to assign to the field</param>
		/// <param name="fixLength">Determines if the length should be truncated if too long. When false, an error will be raised if data is too large to be assigned to the field.</param>
		public void SetValue(FieldNameConstants field, object newValue, bool fixLength)
		{
			if (field == FieldNameConstants.TitleOfCourtesy)
			{
				if (newValue == null)
				{
					this.TitleOfCourtesy = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.TitleOfCourtesy);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.TitleOfCourtesy = v;
				}
				return;
			}
			else if (field == FieldNameConstants.Title)
			{
				if (newValue == null)
				{
					this.Title = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.Title);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.Title = v;
				}
				return;
			}
			else if (field == FieldNameConstants.ReportsTo)
			{
				if (newValue == null)
				{
					this.ReportsTo = null;
				}
				else
				{
					if(Widgetsphere.Core.Util.ReflectionHelper.ImplementsInterface(newValue, typeof(IWrappingClass)))
					{
						this.ReportsTo = ((Employee)newValue).EmployeeId;
					} else if(newValue is IPrimaryKey)
					{
						this.ReportsTo = ((EmployeePrimaryKey)newValue).EmployeeId;
					} else
					if (newValue is string)
					{
						this.ReportsTo = int.Parse((string)newValue);
					} else if (!(newValue is int?)) {
						this.ReportsTo = int.Parse(newValue.ToString());
					}
					else if (newValue is IBusinessObject)
					{
						throw new Exception("An invalid object of type 'IBusinessObject' was passed in. Perhaps a relationship was not enforced correctly.");
					}
					else
					this.ReportsTo = (int?)newValue;
				}
				return;
			}
			else if (field == FieldNameConstants.Region)
			{
				if (newValue == null)
				{
					this.Region = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.Region);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.Region = v;
				}
				return;
			}
			else if (field == FieldNameConstants.PostalCode)
			{
				if (newValue == null)
				{
					this.PostalCode = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.PostalCode);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.PostalCode = v;
				}
				return;
			}
			else if (field == FieldNameConstants.PhotoPath)
			{
				if (newValue == null)
				{
					this.PhotoPath = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.PhotoPath);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.PhotoPath = v;
				}
				return;
			}
			else if (field == FieldNameConstants.Photo)
			{
				if (newValue == null)
				{
					this.Photo = null;
				}
				else
				{
					this.Photo = (System.Byte[])newValue;
				}
				return;
			}
			else if (field == FieldNameConstants.Notes)
			{
				if (newValue == null)
				{
					this.Notes = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.Notes);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.Notes = v;
				}
				return;
			}
			else if (field == FieldNameConstants.LastName)
			{
				if (newValue == null)
				{
					this.LastName = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.LastName);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.LastName = v;
				}
				return;
			}
			else if (field == FieldNameConstants.HomePhone)
			{
				if (newValue == null)
				{
					this.HomePhone = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.HomePhone);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.HomePhone = v;
				}
				return;
			}
			else if (field == FieldNameConstants.HireDate)
			{
				if (newValue == null)
				{
					this.HireDate = null;
				}
				else
				{
					if (newValue is string)
					{
						this.HireDate = DateTime.Parse((string)newValue);
					} else if (!(newValue is DateTime?)) {
						this.HireDate = DateTime.Parse(newValue.ToString());
					}
					else if (newValue is IBusinessObject)
					{
						throw new Exception("An invalid object of type 'IBusinessObject' was passed in. Perhaps a relationship was not enforced correctly.");
					}
					else
					this.HireDate = (DateTime?)newValue;
				}
				return;
			}
			else if (field == FieldNameConstants.FirstName)
			{
				if (newValue == null)
				{
					this.FirstName = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.FirstName);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.FirstName = v;
				}
				return;
			}
			else if (field == FieldNameConstants.Extension)
			{
				if (newValue == null)
				{
					this.Extension = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.Extension);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.Extension = v;
				}
				return;
			}
			else if (field == FieldNameConstants.EmployeeId)
			{
				throw new Exception("Field '" + field.ToString() + "' is a primary key and cannot be set!");
			}
			else if (field == FieldNameConstants.Country)
			{
				if (newValue == null)
				{
					this.Country = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.Country);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.Country = v;
				}
				return;
			}
			else if (field == FieldNameConstants.City)
			{
				if (newValue == null)
				{
					this.City = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.City);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.City = v;
				}
				return;
			}
			else if (field == FieldNameConstants.BirthDate)
			{
				if (newValue == null)
				{
					this.BirthDate = null;
				}
				else
				{
					if (newValue is string)
					{
						this.BirthDate = DateTime.Parse((string)newValue);
					} else if (!(newValue is DateTime?)) {
						this.BirthDate = DateTime.Parse(newValue.ToString());
					}
					else if (newValue is IBusinessObject)
					{
						throw new Exception("An invalid object of type 'IBusinessObject' was passed in. Perhaps a relationship was not enforced correctly.");
					}
					else
					this.BirthDate = (DateTime?)newValue;
				}
				return;
			}
			else if (field == FieldNameConstants.Address)
			{
				if (newValue == null)
				{
					this.Address = null;
				}
				else
				{
					string v = newValue.ToString();
					if (fixLength)
					{
						int fieldLength = GetFieldLength(FieldNameConstants.Address);
						if (v.Length > fieldLength) v = v.Substring(0, fieldLength);
					}
					this.Address = v;
				}
				return;
			}
			throw new Exception("Field '" + field.ToString() + "' not found!");
		}

		#endregion

		#region GetFieldLength

		/// <summary>
		/// Determines the length of the specified field if it can be set.
		/// </summary>
		public int GetFieldLength(Employee.FieldNameConstants field)
		{
			if(field == FieldNameConstants.TitleOfCourtesy) return 25;
			if(field == FieldNameConstants.Title) return 30;
			if(field == FieldNameConstants.Region) return 15;
			if(field == FieldNameConstants.PostalCode) return 10;
			if(field == FieldNameConstants.PhotoPath) return 255;
			if(field == FieldNameConstants.Notes) return 16;
			if(field == FieldNameConstants.LastName) return 20;
			if(field == FieldNameConstants.HomePhone) return 24;
			if(field == FieldNameConstants.FirstName) return 10;
			if(field == FieldNameConstants.Extension) return 4;
			if(field == FieldNameConstants.Country) return 15;
			if(field == FieldNameConstants.City) return 15;
			if(field == FieldNameConstants.Address) return 60;
			//Catch all for all other data types
			return -1;
		}
		#endregion

		#region Clone

		/// <summary>
		/// Create a copy of this object.
		/// </summary>
		public virtual IBusinessObject Clone()
		{
			lock (this)
			{
				if (!this.IsParented) throw new Exception("The current item must be parented.");
				Employee newItem = null;
				lock (this.ParentCollection.SubDomain)
				{
					newItem = new Employee(this.ParentCollection.wrappedClass.NewItem());
				}
				this.FillClone(newItem);
				return newItem;
			}
		}

		/// <summary>
		/// Create a copy of this object.
		/// <param name="employeeid">The employeeid field</param>
		/// </summary>
		public virtual IBusinessObject Clone(int employeeid)
		{
			lock (this)
			{
				if (!this.IsParented) throw new Exception("The current item must be parented.");
				Employee newItem = null;
				lock (this.ParentCollection.wrappedClass.SubDomain)
				{
				newItem = new Employee(this.ParentCollection.wrappedClass.NewItem(employeeid));
				}
				this.FillClone(newItem);
				return newItem;
			}
		}

		private void FillClone(Employee newItem)
		{
			lock (this)
			{
				lock (newItem)
				{
					newItem.TitleOfCourtesy = this.TitleOfCourtesy;
					newItem.Title = this.Title;
					newItem.ReportsTo = this.ReportsTo;
					newItem.Region = this.Region;
					newItem.PostalCode = this.PostalCode;
					newItem.PhotoPath = this.PhotoPath;
					newItem.Photo = this.Photo;
					newItem.Notes = this.Notes;
					newItem.LastName = this.LastName;
					newItem.HomePhone = this.HomePhone;
					newItem.HireDate = this.HireDate;
					newItem.FirstName = this.FirstName;
					newItem.Extension = this.Extension;
					newItem.Country = this.Country;
					newItem.City = this.City;
					newItem.BirthDate = this.BirthDate;
					newItem.Address = this.Address;
				}
			}
		}

		object ICloneable.Clone()
		{
			return this.Clone();
		}

		#endregion

		#region Image Methods

		/// <summary>
		/// Load the specified image file into the specified image column
		/// </summary>
		/// <param name="field">The image column of this object</param>
		/// <param name="fileName">The disk file to load</param>
		public void LoadImageFromFile(FieldImageConstants field, string fileName)
		{
			if (!File.Exists(fileName)) throw new Exception("The file does not exist!");
			FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
			byte[] barr = new byte[fs.Length];
			fs.Read(barr, 0, barr.Length);
			fs.Close();

			switch (field)
			{
				case FieldImageConstants.Photo:
					this.Photo = barr;
					break;
			}
		}

		/// <summary>
		/// Save the specified image to file
		/// </summary>
		/// <param name="field">The image column of this object</param>
		/// <param name="fileName">The new disk file to save</param>
		public void SaveImageToFile(FieldImageConstants field, string fileName)
		{
			if (File.Exists(fileName)) throw new Exception("The file already exists!");
			byte[] barr;
			switch (field)
			{
				case FieldImageConstants.Photo:
					if (this.Photo == null) throw new Exception("The image cannot be null!");
					barr = this.Photo;
					break;
				default:
					throw new Exception("Unknown field!");
			}
			FileStream fs = File.Create(fileName, barr.Length);
			fs.Write(barr, 0, barr.Length);
			fs.Close();		
		}

		#endregion

		#region Helper Methods

		string IBusinessObject.GetFriendlyName(Enum field)
		{
			return "";
		}

		/// <summary>
		/// Gets the maximum size of the field value.
		/// </summary>
		public static int GetMaxLength(FieldNameConstants field)
		{
			switch (field)
			{
				case FieldNameConstants.Address:
					return 60;
				case FieldNameConstants.BirthDate:
					return 0;
				case FieldNameConstants.City:
					return 15;
				case FieldNameConstants.Country:
					return 15;
				case FieldNameConstants.EmployeeId:
					return 0;
				case FieldNameConstants.Extension:
					return 4;
				case FieldNameConstants.FirstName:
					return 10;
				case FieldNameConstants.HireDate:
					return 0;
				case FieldNameConstants.HomePhone:
					return 24;
				case FieldNameConstants.LastName:
					return 20;
				case FieldNameConstants.Notes:
					return int.MaxValue;
				case FieldNameConstants.Photo:
					return int.MaxValue;
				case FieldNameConstants.PhotoPath:
					return 255;
				case FieldNameConstants.PostalCode:
					return 10;
				case FieldNameConstants.Region:
					return 15;
				case FieldNameConstants.ReportsTo:
					return 0;
				case FieldNameConstants.Title:
					return 30;
				case FieldNameConstants.TitleOfCourtesy:
					return 25;
			}
			return 0;
		}

		int IBusinessObject.GetMaxLength(Enum field)
		{
			return GetMaxLength((FieldNameConstants)field);
		}

		string IBusinessObject.GetMask(Enum field)
		{
			return "";
		}

		/// <summary>
		/// Select a single object from this collection by its primary key.
		/// </summary>
		public static Employee SelectUsingPK(int employeeid)
		{
			return SelectUsingPK(employeeid, "");
		}

		/// <summary>
		/// Select a single object from this collection by its primary key.
		/// </summary>
		public static Employee SelectUsingPK(int employeeid, string modifier)
		{
			EmployeeCollection employee = EmployeeCollection.SelectUsingPK(employeeid, modifier);
			if (employee.Count > 1) throw new Exception("Employee primary key returned more than one value.");
			else if (employee.Count == 0) return null;
			else return employee[0];
		}

		#endregion

		#region IBusinessObject Members

		IPrimaryKey IBusinessObject.PrimaryKey
		{
			get { return this.PrimaryKey; }
		}

		object IBusinessObject.GetValue(Enum field)
		{
			return this.GetValue((FieldNameConstants)field);
		}

		object IBusinessObject.GetValue(Enum field, object defaultValue)
		{
			return this.GetValue((FieldNameConstants)field, defaultValue);
		}

		double IBusinessObject.GetDouble(Enum field)
		{
			return this.GetDouble((FieldNameConstants)field);
		}

		double IBusinessObject.GetDouble(Enum field, double defaultValue)
		{
			return this.GetDouble((FieldNameConstants)field, defaultValue);
		}

		DateTime IBusinessObject.GetDateTime(Enum field)
		{
			return this.GetDateTime((FieldNameConstants)field);
		}

		DateTime IBusinessObject.GetDateTime(Enum field, DateTime defaultValue)
		{
			return this.GetDateTime((FieldNameConstants)field, defaultValue);
		}

		int IBusinessObject.GetInteger(Enum field)
		{
			return this.GetInteger((FieldNameConstants)field);
		}

		int IBusinessObject.GetInteger(Enum field, int defaultValue)
		{
			return this.GetInteger((FieldNameConstants)field, defaultValue);
		}

		string IBusinessObject.GetString(Enum field)
		{
			return this.GetString((FieldNameConstants)field);
		}

		string IBusinessObject.GetString(Enum field, string defaultValue)
		{
			return this.GetString((FieldNameConstants)field, defaultValue);
		}

		void IPersistableBusinessObject.SetValue(Enum field, object newValue)
		{
			this.SetValue((FieldNameConstants)field, newValue);
		}

		Enum IBusinessObject.Container
		{
			get { return this.Container; }
		}

		/// <summary>
		/// Determines if all of the fields for the specified object exactly matches the current object.
		/// </summary>
		/// <param name="item">The object to compare</param>
		public override bool IsEquivalent(IBusinessObject item)
		{
			if (item == null) return false;
			if (!(item is Employee)) return false;
			Employee o = item as Employee;
			return (
				o.TitleOfCourtesy == this.TitleOfCourtesy &&
				o.Title == this.Title &&
				o.ReportsTo == this.ReportsTo &&
				o.Region == this.Region &&
				o.PostalCode == this.PostalCode &&
				o.PhotoPath == this.PhotoPath &&
				o.Photo == this.Photo &&
				o.Notes == this.Notes &&
				o.LastName == this.LastName &&
				o.HomePhone == this.HomePhone &&
				o.HireDate == this.HireDate &&
				o.FirstName == this.FirstName &&
				o.Extension == this.Extension &&
				o.EmployeeId == this.EmployeeId &&
				o.Country == this.Country &&
				o.City == this.City &&
				o.BirthDate == this.BirthDate &&
				o.Address == this.Address
				);
		}

		#endregion

		#region IAuditable Members

		string IAuditable.CreatedBy
		{
			get { return this.CreatedBy; }
		}

		DateTime? IAuditable.CreatedDate
		{
			get { return this.CreatedDate; }
		}

		bool IAuditable.IsCreateAuditImplemented
		{
			get { return true; }
		}

		bool IAuditable.IsModifyAuditImplemented
		{
			get { return true; }
		}

		bool IAuditable.IsTimestampAuditImplemented
		{
			get { return true; }
		}

		string IAuditable.ModifiedBy
		{
			get { return this.ModifiedBy; }
		}

		DateTime? IAuditable.ModifiedDate
		{
			get { return this.ModifiedDate; }
		}

		byte[] IAuditable.TimeStamp
		{
			get { return this.TimeStamp; }
		}

		#endregion

	}

}
